package example.documentbased
{
	import example.documentbased.editorModule.models.EditorModuleModel;
	import example.documentbased.mainModule.mediations.EditorsFacade;
	import example.documentbased.mainModule.models.MainModel;
	
	import flash.events.Event;
	
	import org.etherframework.mediation.EtherPreloader;
	import org.etherframework.mediation.Mediations;
	
	public final class Preloader extends EtherPreloader
	{
		override protected function startProgressPhase():void
		{
			// Here should be placed all classes which are marked as 
			// IMediationProvider for early processing.
			Mediations.prepare([MainModel, EditorModuleModel, EditorsFacade])
				.addEventListener(Event.COMPLETE, prepareCompleteHandler);
		}
		
		private function prepareCompleteHandler(event:Event):void
		{
			event.target.removeEventListener(Event.COMPLETE, prepareCompleteHandler);
				
			completeProgressPhase();
		}
	}
}